<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ProjectYsEditRequest extends BaseFormRequest
{


    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'id'=>'required|exists:project_ys,id',
            'project'=>'required|array',
            'ysData'=>'required|array',
            'is_save'=>'required|in:0,1',
            'baseinfo'=>'required|array',
            'ysData.*.title'=>"required|string",
            'ysData.*.money'=>"required|string",
            //'ysData.*.desc'=>"required|string",
            'ysData.*.paytype'=>"required|numeric",
        ];
    }

    public function messages()
    {
        return [
            'id.required'=>'预算ID不能为空',
            'ysData.required'=>'预算列表不能为空',
            'ysData.*.title.required'=>'预算名称不能为空',
            'ysData.*.money.required'=>'预算金额不能为空',
            'ysData.*.desc.required'=>'预算备注不能为空',
            'ysData.*.paytype.required'=>'预算类型不能为空',
        ];
    }
}
